#ifndef HBB_BOX_H
#define HBB_BOX_H

#include "src/math/vector3d.h"

#include "src/scene/ray.h"
#include "src/scene/color.h"
#include "src/scene/material.h"

class NearestInfo;

class HBBBox{
	public:
		HBBBox(const Vector3D &_min = Vector3D(0,0,0), const Vector3D &_max = Vector3D(0,0,0)) : min(_min), max(_max) {};
		~HBBBox(){};

		void setMinMax(const Vector3D &_min, const Vector3D &_max) {min = _min; max = _max;};
		void setMin(const Vector3D &_min) {min = _min;};
		void setMax(const Vector3D &_max) {max = _max;};

		void getMinMax(Vector3D *_min, Vector3D *_max) const {*_min = min; *_max = max;};
		const Vector3D &getMin() const {return min;};
		const Vector3D &getMax() const {return max;};

//		void draw(bool, const Material &) const;
		void draw(const Color & = Color(1, 0, 0)) const;

		bool hit(const Ray &, NearestInfo *) const;

	private:
        Vector3D min, max;
};

void boxPoints(const Vector3D &, const Vector3D &, Vector3D *);
void drawBox(const Vector3D &, const Vector3D &, bool = false, double = 0, double = 1, double = 0, double = 1);

#endif

